import request from '../utils/request'
import type { BannerListData, MenuListData, GoodsListData } from '../types/home'

// 轮播图
export const getBannerList = () => {
  return request<BannerListData[]>({
    url: 'banner/list',
    method: 'GET'
  })
}
// 菜单列表
export const getMenuList = () => {
  return request<MenuListData[]>({
    url: 'menu/list',
    method: 'GET'
  })
}
// 商品数据列表
export const getGoodsList = (count = 1, limitNum = 10) => {
  return request<GoodsListData[]>({
    url: 'pro/list',
    method: 'GET',
    data: {
      count,
      limitNum
    }
  })
}

export const getGoodsDetail = (proid: string) => {
  return request<GoodsListData>({
    url: `pro/detail/${proid}`,
    method:'GET'
  })
}

// 商品数据列表
export const getAllGoodsList = (count = 1, limitNum = 100) => {
  return request<GoodsListData[]>({
    url: 'pro/list',
    method: 'GET',
    data: {
      count,
      limitNum
    }
  })
}
